<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Data-Table 表格</title>
    <link rel="stylesheet" href="../../frame/layui/css/layui.css">
    <link rel="stylesheet" href="../../frame/static/css/style.css">
    <link rel="stylesheet" href="../../css/common.css">
    <style>
        img{
            height: 100%;
        }
    </style>
</head>
<body class="body">
<!-- 工具集 -->
<div class="my-btn-box">
    <span class="fl">
        <a class="layui-btn btn-add btn-default" id="btn-refresh" onclick="location.reload()"><i class="layui-icon">&#x1002;</i></a>
    </span>
</div>

<!-- 表格 -->
<div class="dateTable">
    <div class="table-title">
        <div style="width: 10%">描述</div>
        <div style="width: 10%">金额</div>
        <div style="width: 15%" >订单编号</div>
        <div style="width: 15%" >创建时间</div>
        <div style="width: 10%" >支付状态</div>
        <div style="width: 15%" >支付时间</div>
        <div style="width: 10%" >用户昵称</div>
    </div>
    <table class="data-table" id="data-table">
    </table>
    <div id="pagebox">

    </div>
</div>
<script src="../../js/public/jquery-3.1.1.min.js"></script>
<script src="../../js/layer/layer.js"></script>
<script src="../../js/public/common.js"></script>
<script>
    $(function(){
        GetList();
    });
    function GetList(){
        let page = GetQueryString('page');
        if(!page)page = 1;
        let data = AjaxForm('admin/Change?page='+page);
        let html=``;
        for (let i=0;i<data.list.length;i++){
            let status = '未支付';
            if(data.list[i].status == 1)status = '已支付';

            html += `<tr class="table-content" style='height: 50px;'>
                    <td style="width: 10%">${data.list[i].desc}</td>
                    <td style="width: 10%">￥${data.list[i].price}</td>
                    <td style="width: 15%">${data.list[i].number}</td>
                    <td style="width: 15%">${formatDateTime(data.list[i].time)}</td>
                    <td style="width: 10%">${status}</td>
                    <td style="width: 15%">${formatDateTime(data.list[i].pay_time)}</td>
                    <td style="width: 10%">${data.list[i].nickname}</td>
                    </tr>
                `;
        }
        WepPage(data.count,page,'change');
        $('#data-table').html(html);
    }
</script>
</body>
</html>